package com.migo.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;

import java.util.Map;

public class RedisCommonTools {


    // 静态字段引用唯一实例:
    private static final RedisCommonTools INSTANCE = new RedisCommonTools();

    // 通过静态方法返回实例:
    public static RedisCommonTools getInstance() {
        return INSTANCE;
    }

    // private构造方法保证外部无法实例化:
    private RedisCommonTools() {
    }

    /**
     * 验证参数是否包含刷新参数
     * 如果包含刷新参数就需要刷新API的缓存
     * @param params
     * @return
     */
    public boolean checkParams(Map<String, Object> params) {
        boolean b = params.containsKey("flush");
        return b;
    }
}
